//
//  AnimeCollectionViewCell.m
//  GentlemanAnime
//
//  Created by dlios on 15-6-29.
//  Copyright (c) 2015年 lanou3g.com 蓝欧科技. All rights reserved.
//

#import "AnimeCollectionViewCell.h"

@implementation AnimeCollectionViewCell

- (void)dealloc
{
    [_tuView release];
    [_picImageView release];
    [_blockImageView release];
    [_textLabel release];
    [_nameLabel release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.tuView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.width * 4 / 3)];
        self.tuView.backgroundColor = [UIColor whiteColor];
        self.tuView.layer.borderWidth = 1;
        self.tuView.layer.borderColor = [[UIColor colorWithWhite:0.581 alpha:1.000] CGColor];
        [self.contentView addSubview:self.tuView];
        [_tuView release];
        
        self.picImageView = [[UIImageView alloc] initWithFrame:CGRectMake(2, 2, self.contentView.frame.size.width - 4, self.contentView.frame.size.width * 4 / 3 - 4)];
        [self.tuView addSubview:self.picImageView];
        [_picImageView release];

        self.textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentView.frame.size.width * 4 / 3, self.contentView.frame.size.width, self.contentView.frame.size.width * 2 / 7)];
        self.textLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:self.textLabel];
        [_textLabel release];
        
        self.blockImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"recommendSectionBg"]];
        self.blockImageView.frame = CGRectMake(0, self.contentView.frame.size.width * 4 / 3 - 28, self.contentView.frame.size.width - 4, 24);
        [self.picImageView addSubview:self.blockImageView];
        [_blockImageView release];
        
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentView.frame.size.width * 4 / 3 - 28, self.contentView.frame.size.width - 4, 24)];
        self.nameLabel.textAlignment = NSTextAlignmentRight;
        self.nameLabel.textColor = [UIColor whiteColor];
        self.nameLabel.font = [UIFont systemFontOfSize:14];
        [self.picImageView addSubview:self.nameLabel];
        [_nameLabel release];
        
    }
    return self;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
